﻿@using Common;
@using Web.helper;
@using (Ajax.BeginForm("", new { }, new AjaxOptions() { HttpMethod = "Post", OnSuccess = "tips(data)", OnBegin = "ValidateLog" }))
{
    <div class="modal fade bs-example-modal-lg" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="z-index:1000">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">新增</h4>
                </div>
                <div class="modal-body">
                    <input type="hidden" name="id" class="form-control" id="id">
                    <div class="form-group">
                        <label for="txt_departmentname">角色名称</label>
                        <input type="text" name="txt_role_name" class="form-control" id="txt_role_name" placeholder="角色名称" required="">
                    </div>
                    <div class="form-group">
                        <label for="txt_departmentname">管理权限</label>
                        <input type="hidden" id="txt_action_type" name="txt_action_type" />
                        <div class="table-responsive">
                            <table class="table table-bordered table-striped">
                                <thead>
                                    <tr>
                                        <td>导航名称</td>
                                        <td>
                                            权限分配
                                        </td>
                                        <td>
                                            <!-- 多选 -->
                                            <div class="fuxuan">

                                                <input type="checkbox" name="chk" class="chklist" />
                                                <!--  -->
                                                <label class="chkbox ckAlls">
                                                    <span class="check-image"></span>
                                                    <span class="radiobox-content">全选</span>
                                                </label>
                                                <!--  -->
                                            </div>
                                        </td>

                                    </tr>
                                </thead>
                                <tbody>
                                    @{
    foreach (var nav in ViewBag.list_nav)
    {
        <tr>
            <th class="text-nowrap">@if (nav.parent_id != 0)
            {<i class="fa fa-folder-open"></i>}  @nav.title</th>
            <td>
                <!-- 多选 -->
                <div class="fuxuan">
                    @foreach (var item in nav.action_type.Split(new char[] { ',' }))
                    {
                        <input type="checkbox" name="chk" class="chklist" />
                                                            <!--  -->
                        <label id="@nav.id" class="chkbox">
                            <span class="check-image"></span>
                            <span class="radiobox-content">@item</span>
                        </label>
                    }
                </div>
            </td>
            <td>
                <!-- 多选 -->
                <div class="fuxuan">

                    <input type="checkbox" name="chk" class="chklist" />
                    <!--  -->
                    <label class="chkbox ckAll">
                        <span class="check-image"></span>
                        <span class="radiobox-content">全选</span>
                    </label>
                    <!--  -->
                </div>
            </td>
        </tr>
    }
                                    }
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭</button>
                    <button class="btn btn-primary block full-width m-b" id="btn_submit" onclick="onck()"><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>保存</button>
                </div>
            </div>
        </div>
    </div>
}